import Vue from 'vue'
import VueRouter from 'vue-router'
import Manage from '../views/Manage.vue'
import User from '../views/User.vue'
import UserLog from '../views/UserLog.vue'
import Login from '../views/Login.vue'
import Userext from '../views/Userext.vue'
import UserextLog from "../views/UserextLog.vue"
import Yearsofservice from '../views/Yearsofservice.vue'
import Location from '../views/Location.vue'
import Age from '../views/Age.vue'

import DriverTime from '../views/DriverTime.vue'
import DriverVehicleType from '../views/DriverVehicleType.vue'
import DriverAge from '../views/DriverAge.vue'
import DriverGender from '../views/DriverGender.vue'

import Adpersonal from '../views/Adpersonal.vue'
import SceneMap from '../views/SceneMap.vue'
import PoliceCase from '../views/PoliceCase.vue'
import QA from '../views/QA.vue'
import Progress from '../views/Progress.vue' // 办案进行维度
import Job from '../views/Job.vue' //职位维度
 

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    redirect:'/login',
    component: Manage,  
    children:[
      {
        path: 'qa',
        name: 'qa',
        component: QA
      },
      {
        path: 'driver-vehicle-type',
        name: 'driver-vehicle-type',
        component: DriverVehicleType
      },
      {
        path: 'driver-gender',
        name: 'driver-gender',
        component: DriverGender
      },
      {
        path: 'driver-age',
        name: 'driver-age',
        component: DriverAge
      },
      {
        path: 'driver-time',
        name: 'driver-time',
        component: DriverTime
      },
      {
        path: 'yearsofservice',
        name: 'yearsofservice',
        component: Yearsofservice
      },
      {
        path: 'age',
        name: 'age',
        component: Age
      },
      {
        path: 'location',
        name: 'location',
        component: Location
      },
      {
        path: 'adpersonal',
        name: 'AccidentAriverPersona',
        component: Adpersonal
      },
      {
        path: 'job',
        name: 'job',
        component: Job
      },
      {
        path: 'progress',
        name: 'progress',
        component: Progress
      },

      {
        path: 'policecase',
        name: 'policecase',
        component: PoliceCase
      },
      {
        path: 'user',
        name: 'User',
        component: User
      },
      {
        path: 'userlog',
        name: 'UserLog',
        component: UserLog
      },
      {
        path: 'userext',
        name: 'Userext',
        component: Userext
      },
      {
        path: 'scenemap',
        name: 'scenemap',
        component: SceneMap
      },
      {
        path: 'userextlog',
        name: 'UserextLog',
        component: UserextLog
      },
      {
        path: '/home',
        name: 'Home',     
        component: () => import(/* webpackChunkName: "about" */ '../views/Home.vue'),
      },
      {
        path: '/map',
        name: 'Map',
        component: () => import(/* webpackChunkName: "about" */ '../views/map/Map.vue')
      },
      {
        path: '/map',
        name: 'map',
        component: () => import(/* webpackChunkName: "about" */ '../views/map/Map.vue')
      }
    ]
  },

  {
    path: '/about',
    name: 'about',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  },
  {
    path: '/login',
    name: 'Login', 
    // component: Login
    component: Login
  },

  {
    path: '/userext',
    name: 'userext',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/Userext.vue')
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
